﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Content;

namespace WindowsGame1.gamePlugins.renderer
{
    class ScoreScreen
    {
        private SpriteFont spriteFont;
        public int player1score = 0;
        public int player2score = 0;

        public ScoreScreen (ContentManager content)
        {
            spriteFont = content.Load<SpriteFont>("Score");
        }

        public void update ( GameTime gameTime, int[] score) {
            player1score = score[0];
            player2score = score[1];
        }

        public SpriteBatch draw ( SpriteBatch spriteBatch, Vector2 position ) {

            if (player1score > 9)
            {

                spriteBatch.DrawString(spriteFont, "LOSE", new Vector2(position.X - 100F, position.Y + 100F), Color.White);
                spriteBatch.DrawString(spriteFont, "WIN", new Vector2(position.X + 160F, position.Y + 100F), Color.White);
            }
            else if (player2score > 9)
            {

                spriteBatch.DrawString(spriteFont, "WIN", new Vector2(position.X - 100F, position.Y + 100F), Color.White);
                spriteBatch.DrawString(spriteFont, "LOSE", new Vector2(position.X + 160F, position.Y + 100F), Color.White);
            }
            return spriteBatch;
        }

    }
}
